home *** CD-ROM | disk | FTP | other *** search
/ All for Cell Phones: Sony Ericsson / Sony-Ericsson 2004.iso / Java / boxe / Boxe.jar / Boxe / CCombatLoading.class (.txt) < prev    next >
Encoding:
Java Class File  |  2002-04-12  |  3.2 KB  |  86 lines

  1. package Boxe;
  2.  
  3. import com.siemens.mp.game.ExtendedImage;
  4. import com.siemens.mp.game.GraphicObjectManager;
  5. import com.siemens.mp.game.TiledBackground;
  6. import javax.microedition.lcdui.Graphics;
  7. import javax.microedition.lcdui.Image;
  8.  
  9. class CCombatLoading extends CScreen {
  10.    static final int LOADING_STEP = 37;
  11.    ExtendedImage doublebuffer;
  12.    Image doublebufferImage;
  13.    TiledBackground tiledBack;
  14.    int _loading_step = 0;
  15.  
  16.    CCombatLoading() {
  17.       System.gc();
  18.       this.tiledBack = PGraphicObj.Load("combat.dat");
  19.       this.tiledBack.setPositionInMap(0, 0);
  20.       System.gc();
  21.       this.doublebufferImage = Image.createImage(104, 80);
  22.       this.doublebuffer = new ExtendedImage(this.doublebufferImage);
  23.       System.gc();
  24.       super._gfxManager = new GraphicObjectManager();
  25.       super._gfxManager.addObject(this.tiledBack);
  26.       System.gc();
  27.    }
  28.  
  29.    void Percent(int var1) {
  30.       this._loading_step = var1 * 37 / 100;
  31.       this.Render();
  32.  
  33.       try {
  34.          Thread.sleep(0L);
  35.          System.gc();
  36.       } catch (Exception var3) {
  37.          System.out.println("Exception: " + var3);
  38.       }
  39.  
  40.    }
  41.  
  42.    public void Render() {
  43.       super._gfxManager.paint(this.doublebuffer, 0, 0);
  44.       this.doublebuffer.getImage().getGraphics().setColor(255, 255, 255);
  45.       this.doublebuffer.getImage().getGraphics().drawRect(48, 71, 40, 7);
  46.       this.doublebuffer.getImage().getGraphics().fillRect(50, 73, this._loading_step, 4);
  47.       this.doublebuffer.blitToScreen(0, 0);
  48.    }
  49.  
  50.    public void Update() {
  51.    }
  52.  
  53.    public void run() {
  54.       System.gc();
  55.  
  56.       try {
  57.          this.Render();
  58.          Thread.sleep(0L);
  59.          this.Percent(5);
  60.          this.Percent(10);
  61.          System.gc();
  62.          CGame._ring_screen = new CRing(this);
  63.          System.gc();
  64.          this.Percent(83);
  65.          this.Percent(85);
  66.          this.Percent(87);
  67.          System.gc();
  68.          this.Percent(90);
  69.          ((CRing)CGame._ring_screen)._round_screen = new CRound();
  70.          System.gc();
  71.          this.Percent(100);
  72.          CGame.SetActiveScreen(CGame._ring_screen);
  73.          CGame._ring_screen.addCommand(CGame.resumeCommand);
  74.          CGame._ring_screen.addCommand(CGame.rematchCommand);
  75.          CGame._ring_screen.addCommand(CGame.resetCommand);
  76.          CGame._ring_screen.addCommand(CGame.exitCommand);
  77.       } catch (Exception var2) {
  78.          System.out.println("Exception: " + var2);
  79.       }
  80.  
  81.    }
  82.  
  83.    public void paint(Graphics var1) {
  84.    }
  85. }
  86.